
#include "System.h"
#include <iostream>
#include "State.h"

System::System(int version)
    : version_(version)
{

}

State* System::CreateBacktrackPoint() const
{
  return new State(version_);
}

void System::BacktrackPoint(State* state)
{
  this->version_ = state->get_version();
  delete state;
}

void System::Upgrade()
{
  ++this->version_;
}

void System::Run() const
{
  std::cout << "系统运行版本为：" << version_ << std::endl;
}
